package cn.wolfcode.cloud.shop.mapper;

import cn.wolfcode.cloud.shop.domain.OrderInfo;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface OrderInfoMapper {

    @Insert("insert into t_order_info(order_no,user_id,good_id,delivery_addr_id,good_name,good_img,good_count,good_price,seckill_price,status,create_date,pay_date) values(#{orderNo},#{userId},#{goodId},#{deliveryAddrId},#{goodName},#{goodImg},#{goodCount},#{goodPrice},#{seckillPrice},#{status},#{createDate},#{payDate})")
    void insert(OrderInfo orderInfo);

    @Select("select * from t_order_info where order_no = #{orderNo}")
    OrderInfo selectByOrderNo(@Param("orderNo") String orderNo);


    @Update("update t_order_info set status = #{status} where order_no = #{orderNo}")
    void updateStatusByOrderNo(@Param("orderNo") String orderNo, @Param("status") Integer status);
}
